Xbasic

INET::FTPSendFile Method

Syntax

.SendFile as L (SourceFile as C, TargetFile as C [, SendBinary as L])

Arguments

SourceFileCharacter

The file to send.

TargetFileCharacter

The target file name.

SendBinaryLogical

Default = .t.. Contents of file are sent as binary. Set to .f. to send file contents as text data.

Returns

resultLogical

Returns .t. if the operation succeed. Otherwise, returns .f.. If an error occurred, the INET::FTP CallResult property will contain more information.

Description

Send a file to the server. Contents are sent as binary unless SendBinary is set to .f.

Example

dim ftp as INET::FTP
ftp.UserName   = "Fred"
ftp.Password   = "Secret"
ftp.EnableSSL  = .t.
ftp.Host       = "ftp.myserver.com"
ftp.UsePassive = .t.

if ftp.SendFile("myData.csv","target.csv") <> .t.
    ' error
    msg = ftp.callResult.error
    ...
end if